home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot / sun3src / db.s < prev    next >
Encoding:
Text File  |  1988-05-13  |  1.6 KB  |  58 lines

  1.  
  2. |
  3. |    @(#)db.s 1.1 86/09/27
  4. |    Copyright (c) 1986 by Sun Microsystems, Inc.
  5. |
  6. |    these routines split and join loop counts for DBcc instruction
  7. |    usage in the memory routines:
  8. |    they also allocate _obs_value, and _exp_value for the memory
  9. |    routines.
  10. |
  11. |    [b|w|l]db_pack
  12. |        does the packing necessary for the loop count -> return
  13. |        left from a DBcc instruction. does the +=1 required.
  14. |        d1(16MSB) d0(16LSB) -> d0
  15. |    [b|w|l]db_unpack
  16. |        does the stuff to go from count -> loop count for
  17. |        DBcc madness. Does shifting and -=1 required.
  18. |        d0 -> d1(16MSB) d0(16LSB)
  19. |
  20.     .text
  21.  
  22.     .globl    bdb_unpack, wdb_unpack, ldb_unpack
  23.     .globl    bdb_pack, wdb_pack, ldb_pack
  24.     .globl    _obs_value, _exp_value
  25.  
  26. ldb_unpack:
  27.         lsrl    #1, d0
  28. wdb_unpack:
  29.         lsrl    #1, d0
  30. bdb_unpack:
  31.         subql   #1, d0          | adjust for dbcc brain mode
  32.         movl    d0, d1          | get bits over to d1
  33.         clrw    d1              | clear what will be the 16 MSB
  34.         swap    d1              | move them
  35.         andl    #0xffff, d0     | clear 16 MSB of d0 too.
  36.         rts                     | we done
  37. |
  38. |       these pack a bc count into d0.  There are three entry points
  39. |       just in case we do something funny in the future. (and to be
  40. |       consistent)
  41. |
  42. ldb_pack:
  43. wdb_pack:
  44. bdb_pack:
  45.         swap    d1              | move MSB to MSB
  46.         movw    d0, d1          | move LSB over to d1
  47.         movl    d1, d0          | return back to d0 for return
  48.         addql   #1, d0          | bump up for dbcc damage in head
  49.         rts                     | give it back to them
  50.  
  51. |    .asciz    "@(#)db.s 1.5 1/12/85 Copyright Sun Micro"
  52. |    .even
  53.     .data
  54. _obs_value:
  55.     .long    0
  56. _exp_value:
  57.     .long    0
  58.